<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Service\Redis;

use Hyperf\Redis\Redis;
use Xin\RedisCollection\StringCollection;

class SmsCollection extends StringCollection
{
    protected $prefix = 'sms:';

    public function redis()
    {
        return di()->get(Redis::class);
    }

    public function setCaptcha(string $id, string $captcha)
    {
        return $this->set('captcha:' . $id, $captcha);
    }

    public function getCaptcha($id)
    {
        return $this->get('captcha:' . $id);
    }
}
